home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / ABUSESRC.ZIP / AbuseSrc / imlib / port / unix / shm_fifo.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-12  |  547 b   |  35 lines

  1. #ifndef __UNIX_SHM_FIFO_HPP_
  2. #define __UNIX_SHM_FIFO_HPP_
  3.  
  4.  
  5. struct fifo_control
  6. {
  7.   long nattached;
  8.   long f_start,f_end;
  9.   long size;
  10. } ;
  11.  
  12. class shm_fifo
  13. {
  14.   unsigned char *data;
  15.   fifo_control *fc;
  16. public :
  17.   int shm_id;
  18.   shm_fifo();
  19.   int create(int size);   // create a fifo of size
  20.   int wait_attach();      // returns 1 if successful
  21.  
  22.  
  23.   int attach(int shm_id);   // attach to already
  24.   int ready_to_read();
  25.   int read(void *buf, int size);
  26.   int write(void *buf, int size);
  27.   ~shm_fifo();
  28. } ;
  29.  
  30.  
  31.  
  32. #endif
  33.  
  34.  
  35.